<template>
	<div class="broadcast-details" :style="'height:'+windowH+'px'">
		<view class="hd-wrapper" :class="active === true ? 'on' : ''" :style="ui_viewColor">
			<view class="store-wrapper" v-if="storeInfo">
				<view class="store-box">
					<view class="left">
						<image :src="storeInfo.mer_avatar" mode="aspectFill"></image>
						<view class="txt">{{storeInfo.mer_name}}</view>
					</view>
					<view class="acea-row store-opeation">
						<navigator v-if="ui_hide_mer_status != 1 && storeInfo.mer_id"
							:url="'/pages/store/index?id='+storeInfo.mer_id" class="link" open-type="redirect">进店
						</navigator>
						<text v-if="storeInfo.service_phone" class="iconfont icon-dadianhua01"
							@click="goCustomer"></text>
					</view>
				</view>
				<view class="chat-top" :style="'height:'+inquiryH+'px'">
					<image :src="plantChat" mode="aspectFill"></image>
				</view>
			</view>

			<!-- 问诊头部 -->
			<view class="inquiry-top" v-if="conversation_id != 0" :style="'height:'+inquiryH+'px'">
				<image :src="inquiryChat" mode="aspectFill"></image>
			</view>

			<scroll-view scroll-y="true" style="height: 100%; overflow: hidden;" :scroll-top="scrollTop"
				scroll-with-animation="true" @scrolltoupper="bindScroll">
				<div class="chat" :class="conversation_id != 0?'inquiry-bot':''" ref="chat">
					<Loading :loaded="status" :loading="loading"></Loading>
					<!-- 客服聊天列表 -->
					<block v-for="(item,index) in history" v-if="userId != 0" :key="index">
						<!-- 系统消息 -->
						<div class="item acea-row row-top" v-if="item.msn_type === 10">
							<chat-tips :tipsType="0" :tipsContent="item.msn"></chat-tips>
						</div>
						<!-- 不展示的消息 -->
						<div class="not-show" v-else-if="item.msn_type == 13"></div>
						<!-- 左边 -->
						<div class="item acea-row row-top" v-else-if="item.send_type == 0">
							<div class="pictrue" @click="userDetail(item.user.uid)">
								<image :src="item.user.avatar  ? item.user.avatar : '/static/images/f.png'"
									mode="aspectFill">
								</image>
							</div>
							<div class="text">
								<div class="acea-row">
									<!--退款订单链接-->
									<navigator
										v-if="item.msn_type === 6 && item.refundOrder && item.refundOrder.refund_order_id"
										open-type="redirect"
										:url="'/pages/order_details/index?order_id='+item.refundOrder.order_id">
										<div class="broadcast-details_num">
											<span>退款单号：{{ item.refundOrder.refund_order_sn }}</span>
										</div>
										<div class="conter acea-row row-middle">
											<div class="broadcast-details_order noPad"
												v-for="(val, inx) in item.refundOrder.refundProduct"
												:key="item.service_log_id">
												<div class="broadcast-details_box noPad" v-if="inx == 0">
													<div class="broadcast_details_img">
														<image :src="val.product.cart_info.product.image" />
														<div class="broadcast_details_model">
															{{item.refundOrder.refund_num}}件商品
														</div>
													</div>
													<div class="broadcast_details_picBox noPad">
														<div class="broadcast_details_tit"
															v-text="val.product.cart_info.product.store_name"></div>
														<div class="broadcast_details_pic">
															￥{{ item.refundOrder.refund_price }}
														</div>
													</div>
												</div>
											</div>
										</div>
									</navigator>
									<!--订单链接-->
									<div v-if="item.msn_type === 5 &&  item.orderInfo && item.orderInfo.order_id">
										<div class="broadcast-details_num acea-row row-middle">
											<span>订单号：{{ item.orderInfo.order_sn }}</span>
											<!-- #ifdef H5 -->
											<button class="copy copy-data"
												:data-clipboard-text="item.orderInfo.order_sn">复制</button>
											<!-- #endif -->
											<!-- #ifndef H5 -->
											<button class="copy"
												@tap.stop="copyText(item.orderInfo.order_sn)">复制</button>
											<!-- #endif -->
										</div>
										<navigator
											:url="'/pages/admin/orderDetail/index?id='+item.orderInfo.order_id+'&mer_id='+item.orderInfo.mer_id"
											open-type="redirect" class="conter acea-row row-middle">
											<div class="broadcast-details_order noPad"
												v-for="(val, inx) in item.orderInfo.orderProduct" :key="val.id">
												<div class="broadcast-details_box noPad" v-if="inx == 0">
													<div class="broadcast_details_img">
														<image :src="val.cart_info.product.image" />
														<div class="broadcast_details_model">
															{{item.orderInfo.total_num}}件商品
														</div>
													</div>
													<div class="broadcast_details_picBox noPad">
														<div class="broadcast_details_tit"
															v-text="val.cart_info.product.store_name"></div>
														<div class="broadcast_details_pic">
															￥{{ item.orderInfo.pay_price }}
														</div>
													</div>
												</div>
											</div>
										</navigator>
									</div>

									<!--商品链接-->
									<div class="conter acea-row row-middle" v-if="item.msn_type === 4 && item.product">
										<div class=" noPad">
											<navigator class="acea-row row-column-around noPad"
												v-if="item.product.product_id"
												:url="`/pages/goods_details/index?id=${item.product.product_id}`"
												open-type="redirect">
												<div class="broadcast_details_img_no">
													<image :src="item.product.image" />
												</div>
												<div class="broadcast_details_picBox_no noPad">
													<div class="broadcast_details_pic">
														￥{{ item.product.price }}
													</div>
													<div class="broadcast_details_tit_no line1"
														v-text="item.product.store_name"></div>
												</div>
											</navigator>
										</div>
									</div>
									<!--预售商品链接-->
									<div class="conter acea-row row-middle"
										v-if="item.msn_type === 7 && item.presell && item.presell.product">
										<div class=" noPad">
											<navigator class="acea-row row-column-around noPad"
												v-if="item.presell.product_presell_id"
												:url="`/pages/activity/presell_details/index?id=${item.presell.product_presell_id}`"
												open-type="redirect">
												<div class="broadcast_details_img_no">
													<image :src="item.presell.product.image" />
												</div>
												<div class="broadcast_details_picBox_no noPad">
													<div class="broadcast_details_pic">
														￥{{ item.presell.price }}
													</div>
													<div class="broadcast_details_tit_no line1"
														v-text="item.presell.store_name"></div>
												</div>
											</navigator>
										</div>
									</div>
									<!--拼团商品链接-->
									<div class="conter acea-row row-middle"
										v-if="item.msn_type === 8 && item.productGroup && item.productGroup.product">
										<div class=" noPad">
											<navigator class="acea-row row-column-around noPad"
												v-if="item.productGroup.product_group_id"
												:url="`/pages/activity/combination_details/index?id=${item.productGroup.product_group_id}`"
												open-type="redirect">
												<div class="broadcast_details_img_no">
													<image :src="item.productGroup.product.image" />
												</div>
												<div class="broadcast_details_picBox_no noPad">
													<div class="broadcast_details_pic">
														￥{{ item.productGroup.product.price }}
													</div>
													<div class="broadcast_details_tit_no line1"
														v-text="item.productGroup.product.store_name"></div>
												</div>
											</navigator>
										</div>
									</div>
									<!-- <div class="conter acea-row row-middle" v-if="item.msn_type === 3">
										<img src="/static/images/signal2.gif" class="signal" style="margin-right: 0.27rem;" />
									</div> -->

									<div class="conter acea-row row-middle" v-if="item.msn_type === 3">
										<image :src="item.msn" @click="clickImg(item.msn)" mode="heightFix" />
									</div>

									<div class="conter acea-row row-middle" v-if="item.msn_type === 2">
										<i class="em" :class="item.msn"></i>
									</div>

									<div class="conter acea-row row-middle" v-if="item.msn_type === 1">
										{{ item.msn }}
									</div>

									<!-- 患者详情 -->
									<div class="conter acea-row row-middle" v-if="item.msn_type === 9">
										<patient-info :patientInfo="item.patientInfo" :diseaseMsg="item.diseaseMsg">
										</patient-info>
									</div>
									<!-- 通话邀请 -->
									<div class="conter acea-row row-middle"
										v-if="item.msn_type === 11 || item.msn_type === 12">
										<chat-invite :msnItem="item" @clickAccept="clickAccept"></chat-invite>
									</div>
								</div>
							</div>
						</div>
						<!-- 右边 -->
						<div class="item acea-row row-top row-right" v-else>
							<div class="text textR">
								<!-- <div class="name">{{ item.service.nickname }}</div> -->
								<div class="acea-row ">
									<!--退款订单链接-->
									<navigator v-if="item.msn_type === 6 && item.refundOrder.refund_order_id"
										open-type="redirect">
										<div class="broadcast-details_num acea-row row-middle">
											<text>订单号：{{ item.refundOrder.refund_order_sn }}</text>
											<!-- #ifdef H5 -->
											<button class="copy copy-data"
												:data-clipboard-text="item.refundOrder.refund_order_sn">复制</button>
											<!-- #endif -->
											<!-- #ifndef H5 -->
											<button class="copy"
												@tap.stop="copyText(item.refundOrder.refund_order_sn)">复制</button>
											<!-- #endif -->
										</div>
										<div class="conter acea-row row-middle">
											<div class="broadcast-details_order noPad"
												v-for="(val, inx) in item.refundOrder.refundProduct" :key="val.id">
												<div class="broadcast-details_box noPad" v-if="inx == 0">
													<div class="broadcast_details_img">
														<image :src="val.product.cart_info.product.image" />
														<div class="broadcast_details_model">
															{{item.refundOrder.refund_num}}件商品
														</div>
													</div>
													<div class="broadcast_details_picBox noPad">
														<div class="broadcast_details_tit"
															v-text="val.product.cart_info.product.store_name"></div>
														<div class="broadcast_details_pic">
															￥{{ item.refundOrder.refund_price }}
														</div>
													</div>
												</div>
											</div>
										</div>
									</navigator>


									<!--订单链接-->
									<div v-if="item.msn_type === 5 && item.orderInfo.order_id">
										<div class="broadcast-details_num acea-row row-middle">
											<text>订单号：{{ item.orderInfo.order_sn }}</text>
											<!-- #ifdef H5 -->
											<button class="copy copy-data"
												:data-clipboard-text="item.orderInfo.order_sn">复制</button>
											<!-- #endif -->
											<!-- #ifndef H5 -->
											<button class="copy"
												@tap.stop="copyText(item.orderInfo.order_sn)">复制</button>
											<!-- #endif -->
										</div>
										<navigator
											:url="'/pages/admin/orderDetail/index?id='+item.orderInfo.order_id+'&mer_id='+item.orderInfo.mer_id"
											open-type="redirect" class="conter acea-row row-middle">
											<div class="broadcast-details_order noPad"
												v-for="(val, inx) in item.orderInfo.orderProduct" :key="val.id">
												<div class="broadcast-details_box noPad" v-if="inx == 0">
													<div class="broadcast_details_img">
														<image :src="val.cart_info.product.image" />
														<div class="broadcast_details_model">
															{{item.orderInfo.total_num}}件商品
														</div>
													</div>
													<div class="broadcast_details_picBox noPad">
														<div class="broadcast_details_tit"
															v-text="val.cart_info.product.store_name"></div>
														<div class="broadcast_details_pic">
															￥{{ item.orderInfo.pay_price }}
														</div>
													</div>
												</div>
											</div>
										</navigator>
									</div>
									<!--商品链接-->
									<div class="conter acea-row row-middle" v-if="item.msn_type === 4 && item.product">
										<div class=" acea-row row-column-around noPad">
											<navigator class="acea-row row-column-around noPad"
												v-if="item.product.product_id"
												:url="`/pages/goods_details/index?id=${item.product.product_id}`"
												open-type="redirect">
												<div class="broadcast_details_img_no">
													<image :src="item.product.image" />
												</div>
												<div class="broadcast_details_picBox_no noPad">
													<div class="broadcast_details_pic">
														￥{{ item.product.price }}
													</div>
													<div class="broadcast_details_tit_no line1"
														v-text="item.product.store_name"></div>
												</div>
											</navigator>
										</div>
									</div>
									<!--预售商品链接-->
									<div class="conter acea-row row-middle"
										v-if="item.msn_type === 7 && item.presell && item.presell.product">
										<div class=" acea-row row-column-around noPad">
											<navigator class="acea-row row-column-around noPad"
												v-if="item.presell.product_presell_id"
												:url="`/pages/activity/presell_details/index?id=${item.presell.product_presell_id}`"
												open-type="redirect">
												<div class="broadcast_details_img_no">
													<image :src="item.presell.product.image" />
												</div>
												<div class="broadcast_details_picBox_no noPad">
													<div class="broadcast_details_pic">
														￥{{ item.presell.price }}
													</div>
													<div class="broadcast_details_tit_no line1"
														v-text="item.presell.store_name"></div>
												</div>
											</navigator>
										</div>
									</div>
									<!--拼团商品链接-->
									<div class="conter acea-row row-middle"
										v-if="item.msn_type === 8 && item.productGroup && item.productGroup.product">
										<div class=" acea-row row-column-around noPad">
											<navigator class="acea-row row-column-around noPad"
												v-if="item.productGroup.product_group_id"
												:url="`/pages/activity/combination_details/index?id=${item.productGroup.product_group_id}`"
												open-type="redirect">
												<div class="broadcast_details_img_no">
													<image :src="item.productGroup.product.image" />
												</div>
												<div class="broadcast_details_picBox_no noPad">
													<div class="broadcast_details_pic">
														￥{{ item.productGroup.product.price }}
													</div>
													<div class="broadcast_details_tit_no line1"
														v-text="item.productGroup.product.store_name"></div>
												</div>
											</navigator>
										</div>
									</div>
									<div class="conter acea-row row-middle" v-if="item.msn_type === 3">
										<image :src="item.msn" @click="clickImg(item.msn)" mode="heightFix" />
									</div>

									<div class="conter acea-row row-middle" v-if="item.msn_type === 2">
										<i class="em" :class="item.msn"></i>
									</div>

									<div class="conter acea-row row-middle" v-if="item.msn_type === 1">
										{{ item.msn }}
									</div>

									<!-- 患者详情 -->
									<div class="conter acea-row row-middle" v-if="item.msn_type === 9">
										<patient-info :patientInfo="item.patientInfo" :diseaseMsg="item.diseaseMsg">
										</patient-info>
									</div>
									<!-- 通话邀请 -->
									<div class="conter acea-row row-middle"
										v-if="item.msn_type === 11 || item.msn_type === 12">
										<chat-invite :msnItem="item" @clickAccept="clickAccept"></chat-invite>
									</div>
								</div>
							</div>
							<div class="pictrue">
								<image :src="item.service.avatar ? item.service.avatar : '/static/images/f.png'"
									mode="aspectFill" />
							</div>
						</div>
					</block>
					<!-- 客户聊天列表 -->
					<block v-for="(item,j) in history" v-if="userId == 0" :key="j">
						<!-- 系统消息 -->
						<div class="item acea-row row-top" v-if="item.msn_type === 10">
							<chat-tips :tipsType="0" :tipsContent="item.msn"></chat-tips>
						</div>
						<!-- 不展示的消息 -->
						<div class="not-show" v-else-if="item.msn_type == 13"></div>
						<!-- 左边 -->
						<!-- 这是新加：{{ judgeShowLeft(item) }} 医生、医助：{{ isDoctor }} -->
						<div class="item acea-row row-top" v-else-if="judgeShowLeft(item)">
							<div class="pictrue" v-if="isDoctor">
								<image :src="item.user.avatar ? item.user.avatar : '/static/images/f.png'"
									mode="aspectFill" />
							</div>
							<div class="pictrue" v-else>
								<image :src="item.service.avatar ? item.service.avatar : '/static/images/f.png'"
									mode="aspectFill"></image>
							</div>
							<div class="text">
								<!-- <div class="name">{{ item.service.nickname }}</div> -->
								<div class="acea-row">
									<!--退款订单链接-->
									<navigator v-if="item.msn_type === 6 && item.refundOrder.refund_order_id"
										open-type="redirect"
										:url="'/pages/order_details/index?order_id='+item.refundOrder.order_id">
										<div class="broadcast-details_num">
											<text>退款单号：{{ item.refundOrder.refund_order_sn }}</text>
										</div>
										<div class="conter acea-row row-middle">
											<!-- :key="item.service_log_id" -->
											<div class="broadcast-details_order noPad"
												v-for="(val, inx) in item.refundOrder.refundProduct">
												<div class="broadcast-details_box noPad" v-if="inx == 0">
													<div class="broadcast_details_img">
														<image :src="val.product.cart_info.product.image" />
														<div class="broadcast_details_model">
															{{item.refundOrder.refund_num}}件商品
														</div>
													</div>
													<div class="broadcast_details_picBox noPad">
														<div class="broadcast_details_tit"
															v-text="val.product.cart_info.product.store_name"></div>
														<div class="broadcast_details_pic">
															￥{{ val.product.cart_info.productAttr.price }}
														</div>
													</div>
												</div>
											</div>
										</div>
									</navigator>
									<!--订单链接-->
									<div v-if="item.msn_type === 5 && item.orderInfo.order_id">
										<div class="broadcast-details_num acea-row row-middle">
											<text>订单号：{{ item.orderInfo.order_sn }}</text>
											<!-- #ifdef H5 -->
											<button class="copy copy-data"
												:data-clipboard-text="item.orderInfo.order_sn">复制</button>
											<!-- #endif -->
											<!-- #ifndef H5 -->
											<button class="copy"
												@tap.stop="copyText(item.orderInfo.order_sn)">复制</button>
											<!-- #endif -->
										</div>
										<navigator :url="'/pages/order_details/index?order_id='+item.orderInfo.order_id"
											open-type="redirect" class="conter acea-row row-middle">
											<!-- :key="item.service_log_id" -->
											<div class="broadcast-details_order noPad"
												v-for="(val, inx) in item.orderInfo.orderProduct">
												<div class="broadcast-details_box noPad" v-if="inx == 0">
													<div class="broadcast_details_img">
														<image :src="val.cart_info.product.image" />
														<div class="broadcast_details_model">
															{{item.orderInfo.total_num}}件商品
														</div>
													</div>
													<div class="broadcast_details_picBox noPad">
														<div class="broadcast_details_tit"
															v-text="val.cart_info.product.store_name"></div>
														<div class="broadcast_details_pic">
															￥{{ item.orderInfo.pay_price }}
														</div>
													</div>
												</div>
											</div>
										</navigator>
									</div>

									<!--商品链接-->
									<div class="conter acea-row row-middle" v-if="item.msn_type === 4 && item.product">
										<div class=" noPad">
											<navigator class="acea-row row-column-around noPad"
												v-if="item.product.product_id"
												:url="`/pages/goods_details/index?id=${item.product.product_id}`"
												open-type="redirect">
												<div class="broadcast_details_img_no">
													<image :src="item.product.image" />
												</div>
												<div class="broadcast_details_picBox_no noPad">
													<div class="broadcast_details_pic">
														￥{{ item.product.price }}
													</div>
													<div class="broadcast_details_tit_no line1"
														v-text="item.product.store_name"></div>
												</div>
											</navigator>
										</div>
									</div>
									<!--预售商品链接-->
									<div class="conter acea-row row-middle"
										v-if="item.msn_type === 7 && item.presell && item.presell.product">
										<div class=" noPad">
											<navigator class="acea-row row-column-around noPad"
												v-if="item.presell.product_presell_id"
												:url="`/pages/activity/presell_details/index?id=${item.presell.product_presell_id}`"
												open-type="redirect">
												<div class="broadcast_details_img_no">
													<image :src="item.presell.product.image" />
												</div>
												<div class="broadcast_details_picBox_no noPad">
													<div class="broadcast_details_pic">
														￥{{ item.presell.price }}
													</div>
													<div class="broadcast_details_tit_no line1"
														v-text="item.presell.store_name"></div>
												</div>
											</navigator>
										</div>
									</div>
									<!--拼团商品链接-->
									<div class="conter acea-row row-middle"
										v-if="item.msn_type === 8 && item.productGroup && item.productGroup.product">
										<div class="noPad">
											<navigator class="acea-row row-column-around noPad"
												v-if="item.productGroup.product_group_id"
												:url="`/pages/activity/combination_details/index?id=${item.productGroup.product_group_id}`"
												open-type="redirect">
												<div class="broadcast_details_img_no">
													<image :src="item.productGroup.product.image" />
												</div>
												<div class="broadcast_details_picBox_no noPad">
													<div class="broadcast_details_pic">
														￥{{ item.productGroup.product.price }}
													</div>
													<div class="broadcast_details_tit_no line1"
														v-text="item.productGroup.product.store_name"></div>
												</div>
											</navigator>
										</div>
									</div>

									<div class="conter acea-row row-middle" v-if="item.msn_type === 3">
										<image :src="item.msn" @click="clickImg(item.msn)" mode="heightFix" />
									</div>

									<div class="conter acea-row row-middle" v-if="item.msn_type === 2">
										<i class="em" :class="item.msn"></i>
									</div>

									<div class="conter acea-row row-middle" v-if="item.msn_type === 1">
										{{ item.msn }}
									</div>

									<!-- 患者详情 -->
									<div class="conter acea-row row-middle" v-if="item.msn_type === 9">
										<patient-info :patientInfo="item.patientInfo" :diseaseMsg="item.diseaseMsg">
										</patient-info>
									</div>
									<!-- 通话邀请 -->
									<div class="conter acea-row row-middle"
										v-if="item.msn_type === 11 || item.msn_type === 12">
										<chat-invite :msnItem="item" @clickAccept="clickAccept"></chat-invite>
									</div>
								</div>
							</div>
						</div>
						<!-- 右边 -->
						<div class="item acea-row row-top row-right" v-else>
							<div class="text textR">
								<!-- <div class="name">{{ item.user.nickname }}</div> -->
								<div class="acea-row ">
									<!--退款订单链接-->
									<navigator v-if="item.msn_type === 6 && item.refundOrder.refund_order_id"
										open-type="redirect"
										:url="'/pages/order_details/index?order_id='+item.refundOrder.order_id">
										<div class="broadcast-details_num">
											<text>退款单号：{{ item.refundOrder.refund_order_sn }}</text>
										</div>
										<div class="conter acea-row row-middle">
											<!-- :key="item.service_log_id" -->
											<div class="broadcast-details_order noPad"
												v-for="(val, inx) in item.refundOrder.refundProduct">
												<div class="broadcast-details_box noPad" v-if="inx == 0">
													<div class="broadcast_details_img">
														<image :src="val.product.cart_info.product.image" />
														<div class="broadcast_details_model">

														</div>
													</div>
													<div class="broadcast_details_picBox noPad">
														<div class="broadcast_details_tit"
															v-text="val.product.cart_info.product.store_name"></div>
														<div class="broadcast_details_pic">
															共{{item.refundOrder.refund_num}}件商品，
															合计 ￥{{ item.refundOrder.refund_price }}
														</div>
													</div>
												</div>
											</div>
										</div>
									</navigator>


									<!--订单链接-->
									<div v-if="item.msn_type === 5 && item.orderInfo.order_id">
										<div class="broadcast-details_num acea-row row-middle">
											<text>订单号：{{ item.orderInfo.order_sn }}</text>
											<!-- #ifdef H5 -->
											<button class="copy copy-data"
												:data-clipboard-text="item.orderInfo.order_sn">复制</button>
											<!-- #endif -->
											<!-- #ifndef H5 -->
											<button class="copy"
												@tap.stop="copyText(item.orderInfo.order_sn)">复制</button>
											<!-- #endif -->
										</div>
										<navigator :url="'/pages/order_details/index?order_id='+item.orderInfo.order_id"
											open-type="redirect" class="conter acea-row row-middle">
											<!-- :key="item.service_log_id" -->
											<div class="broadcast-details_order noPad"
												v-for="(val, inx) in item.orderInfo.orderProduct">
												<div class="broadcast-details_box noPad" v-if="inx == 0">
													<div class="broadcast_details_img">
														<image :src="val.cart_info.product.image" />
														<div class="broadcast_details_model">
															{{item.orderInfo.total_num}}件商品
														</div>
													</div>
													<div class="broadcast_details_picBox noPad">
														<div class="broadcast_details_tit"
															v-text="val.cart_info.product.store_name"></div>
														<div class="broadcast_details_pic">
															￥{{ item.orderInfo.pay_price }}
														</div>
													</div>
												</div>
											</div>
										</navigator>
									</div>
									<!--商品链接-->
									<div class="conter acea-row row-middle" v-if="item.msn_type === 4 && item.product">
										<div class="acea-row row-column-around noPad">
											<navigator class="acea-row row-column-around noPad"
												v-if="item.product.product_id"
												:url="`/pages/goods_details/index?id=${item.product.product_id}`"
												open-type="redirect">
												<div class="broadcast_details_img_no">
													<image :src="item.product.image" />
												</div>
												<div class="broadcast_details_picBox_no noPad">
													<div class="broadcast_details_pic">
														￥{{ item.product.price }}
													</div>
													<div class="broadcast_details_tit_no line1"
														v-text="item.product.store_name"></div>
												</div>
											</navigator>
										</div>
									</div>
									<!--预售商品链接-->
									<div class="conter acea-row row-middle"
										v-if="item.msn_type === 7 && item.presell && item.presell.product">
										<div class="acea-row row-column-around noPad">
											<navigator class="acea-row row-column-around noPad"
												v-if="item.presell.product_presell_id"
												:url="`/pages/activity/presell_details/index?id=${item.presell.product_presell_id}`"
												open-type="redirect">
												<div class="broadcast_details_img_no">
													<image :src="item.presell.product.image" />
												</div>
												<div class="broadcast_details_picBox_no noPad">
													<div class="broadcast_details_pic">
														￥{{ item.presell.price }}
													</div>
													<div class="broadcast_details_tit_no line1"
														v-text="item.presell.store_name"></div>
												</div>
											</navigator>
										</div>
									</div>
									<!--拼团商品链接-->
									<div class="conter acea-row row-middle"
										v-if="item.msn_type === 8 && item.productGroup && item.productGroup.product">
										<div class=" acea-row row-column-around noPad">
											<navigator class="acea-row row-column-around noPad"
												v-if="item.productGroup.product_group_id"
												:url="`/pages/activity/combination_details/index?id=${item.productGroup.product_group_id}`"
												open-type="redirect">
												<div class="broadcast_details_img_no">
													<image :src="item.productGroup.product.image" />
												</div>
												<div class="broadcast_details_picBox_no noPad">
													<div class="broadcast_details_pic">
														￥{{ item.productGroup.product.price }}
													</div>
													<div class="broadcast_details_tit_no line1"
														v-text="item.productGroup.product.store_name"></div>
												</div>
											</navigator>
										</div>
									</div>
									<div class="conter acea-row row-middle" v-if="item.msn_type === 3">
										<image :src="item.msn" @click="clickImg(item.msn)" mode="heightFix" />
									</div>
									<div class="conter acea-row row-middle" v-if="item.msn_type === 2">
										<i class="em" :class="item.msn"></i>
									</div>
									<div class="conter acea-row row-middle" v-if="item.msn_type === 1">
										{{ item.msn }}
									</div>
									<!-- 患者详情 -->
									<div class="conter acea-row row-middle" v-if="item.msn_type === 9">
										<patient-info :patientInfo="item.patientInfo" :diseaseMsg="item.diseaseMsg">
										</patient-info>
									</div>
									<!-- 通话邀请 -->
									<div class="conter acea-row row-middle"
										v-if="item.msn_type === 11 || item.msn_type === 12">
										<chat-invite :msnItem="item" @clickAccept="clickAccept"></chat-invite>
									</div>

								</div>
							</div>
							<div class="pictrue" v-if="isDoctor">
								<image :src="item.service.avatar ? item.service.avatar : '/static/images/f.png'"
									mode="aspectFill"></image>
							</div>
							<div class="pictrue" v-else>
								<image :src="item.user.avatar ? item.user.avatar : '/static/images/f.png'"
									mode="aspectFill" />
							</div>
						</div>
					</block>

					<view class="footer_box" v-if="productId || orderId || refund_order_id"></view>
					<div class="broadcast-details_order footer_count" :style="'bottom:' + goodsViewBottom + 'rpx;'">
						<!-- 商品信息 -->
						<div class="broadcast-details_box" v-if="productId && productInfo.product_id">
							<text class="iconfont icon-guanbi" @click.stop="productId = ''"></text>
							<div class="broadcast_details_img">
								<image v-if="!presellId" :src="productInfo.image" />
								<image v-else :src="productInfo.product.image" />
							</div>
							<div class="broadcast_details_picBox">
								<div class="broadcast_details_tit" v-text="productInfo.store_name"></div>
								<div class="acea-row row-between product_price">
									<div class="broadcast_details_pic p-color">
										￥{{ productInfo.price}}
									</div>
									<div class="broadcast_details_btn product_btn" @click="sendProduct">发送商品</div>
								</div>
							</div>
						</div>
						<!-- 订单信息 -->
						<div class="broadcast_box" v-if="orderId && orderInfo.order_id">
							<text class="iconfont icon-guanbi" @click.stop="orderId = ''"></text>
							<div class="broadcast-details_num broadcast_num acea-row row-between-wrapper">
								<text>订单号：{{ orderInfo.order_sn }}</text>
								<!-- <span class="line1">{{ orderInfo.pay_time }}</span> -->
							</div>
							<div class="broadcast-details_box">
								<div class="broadcast_details_img">
									<image :src="cartInfo.cart_info.product.image" />
								</div>
								<div class="broadcast_details_picBox">
									<div class="broadcast_details_tit">
										{{ cartInfo.cart_info.product.store_name }}
									</div>
									<div>
										<div class="broadcast_details_pic">
											共{{ orderInfo.total_num }}件商品，合计 <text
												class="p-color">￥{{ orderInfo.pay_price }}</text>
										</div>
										<div class="broadcast_details_btn" @click="sendOrder">
											发送订单
										</div>
									</div>
								</div>
							</div>
						</div>
						<!-- 退款订单 -->
						<div class="broadcast_box" v-if="refund_order_id && refundDetail.refund_order_id">
							<text class="iconfont icon-guanbi" @click.stop="refund_order_id = ''"></text>
							<div class="broadcast-details_num broadcast_num">
								<text>退款单号：{{ refundDetail.refund_order_sn }}</text>
							</div>
							<div class="broadcast-details_box">
								<div class="broadcast_details_img">
									<image :src="refundDetail.refundProduct[0].product.cart_info.product.image" />
								</div>
								<div class="broadcast_details_picBox">
									<div class="broadcast_details_tit">
										{{ refundDetail.refundProduct[0].product.cart_info.product.store_name }}
									</div>
									<div>
										<div class="broadcast_details_pic">
											共{{ refundDetail.refund_num }}件商品，
											合计 <text class="p-color">￥{{ refundDetail.refund_price}}</text>
										</div>
										<div class="broadcast_details_btn refund_btn" @click="sendRefundOrder">
											发送退款单
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>

				</div>
				<div :style=" active === true ? 'height:' + footerConH + 'rem;' : 'height:' + footerH + 'rem;'"> </div>
			</scroll-view>
		</view>

		<view class="inquiry-status" :class="conversation_status == 0?'':'tool-hidden' ">
			<!-- 用户端结束问诊;医生端也可主动结束 -->
			<view class="inquiry-end" :class="active === true ? 'on' : ''" v-if="conversation_id != 0"
				@click="endInquiry">
				<text class="yyfont yy-jieshu"></text>结束问诊
			</view>
			<!-- 医生端发起视频 -->
			<view v-if="isDoctor && conversition_type == 2" class="inquiry-rtc-start"
				:class="active === true ? 'on' : ''" @click="startVideo">
				<image src="../static/images/rtc_start.png" mode="aspectFit"></image>
			</view>
			<div class="footerCon" :class="active === true ? 'on' : 'noactive'"
				:style="'transform: translate3d(0,' + percent + '%,0);'" ref="footerCon">
				<form>
					<div class="footer acea-row row-between row-bottom" ref="footer">
						<text @click="uploadImg" class="iconfont icon-tupian2"></text>
						<text @click="emoticon" class="iconfont icon-biaoqing2"></text>
						<div class="voice acea-row row-center-wrapper" v-if="voice" @touchstart.prevent="start"
							@touchmove.prevent="move" @touchend.prevent="end">
							{{ speak }}
						</div>
						<view class="input_count">
							<input type="text" placeholder-class='placeholder' placeholder="输入内容" class="input"
								ref="input" v-show="!voice" @input="bindInput" @keyup="keyup" @focus="focus"
								cursor-spacing="20" v-model="textCon">
							<div class="send iconfont icon-fasong" @click="sendTest"></div>
						</view>
					</div>
					<view class="bot-safe" :class="active === true ? '':'yy-safe-bh'" :style="'background:#fff'"></view>
				</form>
				<div class="banner slider-banner">
					<swiper class="swiper-wrapper" :autoplay="autoplay" :circular="circular" :interval="interval"
						:duration="duration" v-if="emojiGroup&&emojiGroup.length > 0">
						<block v-for="(emojiList, index) in emojiGroup" :key="index">
							<swiper-item>
								<i class="em" :class="emoji" v-for="emoji in emojiList" :key="emoji"
									@click="addEmoji(emoji)"></i>
								<image src="/static/images/del.png" class="emoji-outer" />
							</swiper-item>
						</block>
					</swiper>
				</div>

			</div>
			<div class="recording" v-if="recording">
				<image src="/static/images/recording.png" />
			</div>

		</view>

		<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
		<!-- 评价 -->
		<inquiry-evaluate :show="showEvaluate" :conversationId="conversation_id" @close="evaluateClose">
		</inquiry-evaluate>

		<!-- 音视频预约信息 -->
		<consult-sheet :showSheet="consultShow" :showType="consultType" @consultClose="consultClose"
			@cancelReg="cancelReg" @clickEvaluate="clickEvaluate" @clickAskAgain="clickAskAgain"></consult-sheet>
		<!-- 预约取消二次提醒 -->
		<consult-alert :regAlertShow="regAlertShow" :conversion_id="conversation_id" @regClose="regClose"
			@regFinish="regFinish"></consult-alert>
		<!-- 通话界面 -->
		<consult-rtc ref="consultRtc" :rtcShow="rtcShow" :conversation_id="conversation_id" :isDoctor="isDoctor"
			@rtcHangup="rtcHangup" @rtcBusy="rtcBusy" @rtcShowUI="rtcShowUI"> </consult-rtc>

	</div>
</template>
<script>
	// +----------------------------------------------------------------------
	// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
	// +----------------------------------------------------------------------
	// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
	// +----------------------------------------------------------------------
	// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
	// +----------------------------------------------------------------------
	// | Author: CRMEB Team <admin@crmeb.com>
	// +----------------------------------------------------------------------
	import emojiList from "@/utils/emoji";
	import Socket from "@/libs/chat";
	// #ifdef H5
	import ClipboardJS from "@/plugin/clipboard/clipboard.js";
	// #endif
	import {
		getChatRecord,
		getMerHistory,
		getInquiryHistory
	} from "@/api/user";
	import {
		getProductDetail,
		getPresellProductDetail,
		getStoreDetail
	} from "@/api/store";
	import {
		getCombinationDetail
	} from "@/api/activity";
	import {
		getOrderDetail,
		refundDetail
	} from "@/api/order";
	import easyUpload from '@/components/easy-upload/easy-upload.vue'
	import Loading from "@/components/Loading";
	import {
		TOKENNAME,
		HTTP_REQUEST_URL
	} from '@/config/app.js';
	import {
		configMap
	} from "@/utils";
	import {
		mapGetters
	} from "vuex";
	import authorize from '@/components/Authorize';

	import inquiryEvaluate from '@/components/inquiryEvaluate.vue'
	import {
		endConsultation,
		endDoctorConsultation,
	} from '@/api/inquiry.js';
	import consultSheet from '@/pages/chat/components/consultSheet.vue';
	import consultAlert from '@/pages/chat/components/consultAlert.vue';

	import patientInfo from '@/pages/chat/components/patientInfo.vue'
	import chatTips from '@/pages/chat/components/chatTips.vue'
	import chatInvite from '@/pages/chat/components/chatInvite.vue'
	import consultRtc from '@/pages/chat/components/consultRtc.vue'

	const chunk = function(arr, num) {
		num = num * 1 || 1;
		var ret = [];
		arr.forEach(function(item, i) {
			if (i % num === 0) {
				ret.push([]);
			}
			ret[ret.length - 1].push(item);
		});
		return ret;
	};

	const NAME = "CustomerService";
	const PATH = 'pages/chat/customer_list/chat'
	const app = getApp();
	export default {
		name: NAME,
		components: {
			Loading,
			easyUpload,
			authorize,
			inquiryEvaluate,
			consultSheet,
			consultAlert,
			patientInfo,
			chatInvite,
			chatTips,
			consultRtc,
		},
		props: {
			couponList: {
				type: Array,
				default: () => []
			}
		},
		computed: {
			...configMap(['hide_mer_status'], mapGetters(['isLogin', 'viewColor'])),
		},
		data: function() {
			return {
				ui_hide_mer_status: 0,
				ui_isLogin: false,
				ui_viewColor: null,

				inquiryChat: HTTP_REQUEST_URL + '/uni_static/i/i_inquiry_chat.png',
				plantChat: HTTP_REQUEST_URL + '/uni_static/i/i_plant_chat.png',
				url: `${HTTP_REQUEST_URL}/api/upload/image`,
				headers: {
					"Authori-zation": "Bearer " + this.$store.state.app.token
				},
				emojiGroup: chunk(emojiList, 20),
				active: false,
				voice: false,
				speak: "按住 说话",
				recording: false,
				swiperOption: {
					pagination: {
						el: ".swiper-pagination",
						clickable: true
					},
					speed: 1000,
					observer: true,
					observeParents: true
				},
				percent: 0,
				footerConH: 0,
				footerH: 1.08,
				socket: null,
				toUid: 0,
				page: 1,
				limit: 30,
				loading: false,
				loaded: false,
				history: [],
				sendColor: false,
				sendtxt: "",
				productId: 0,
				presellId: 0,
				combinationId: 0,
				productInfo: {},
				orderId: "",
				orderInfo: {},
				cartInfo: {},
				autoplay: false,
				circular: true,
				interval: 3000,
				duration: 500,
				upload_max: 2, //图片大小
				//上传的图片地址
				uploadImages: [],
				//展示的图片地址
				uploads: [],
				// 超出限制数组
				exceeded_list: [],
				windowH: 0,
				windowW: 0,
				inquiryH: 0,
				chatTH: 0,
				isBQ: false,
				scrollTop: 0, //滚动距离
				textCon: '', //文字
				mer_id: 0, //商铺id
				refund_order_id: 0, //退款订单id
				refundDetail: '', //退款订单详情
				userId: 0, //客服----用户id
				pageType: 0, //页面区分
				status: false, //砍价列表是否获取完成 false 未完成 true 完成
				storeInfo: '',
				isBack: false,
				isAuto: false, //没有授权的不会自动授权
				isShowAuth: false, //是否隐藏授权
				conversation_id: 0, //问诊会话id
				conversation_status: 0, //0-进行中 1-已完成 2-已取消【视频问诊新加2】
				showEvaluate: false, //评价
				patient_id: 0, // 问诊患者信息
				isDoctor: false, // 医生或者医助

				consultShow: false, //音视频：咨询状态弹窗
				consultType: 0, //0-预约可取消  1-结束可评价
				regAlertShow: false,

				send_tips: 0, // 是否发送系统消息
				conversition_type: 1, //0-图文[这里用不到0]  1-在线  2-视频
				can_refund: 0, //1-能取消  0-不能取消【当conversition_type=2时有效】
				rtcShow: false,
				rtcIsFull: true,
				goodsViewBottom: 120,
			};
		},
		watch: {},
		beforeDestroy() {
			uni.$off(["socket_open", "reply", "chat", "send_chat", "send_chat_inquiry", "socket_error", "socket_close"])

		},

		onUnload() {
			this.wsEnd();
			// 防止意外挂断,状态未重置
			this.$refs.consultRtc.getChatEnd();

		},
		onLoad(option) {
			//rk_tips_rtc====>
			if (option.from && option.from == 'h5') {
				console.log("rk===>[来自h5]");
				this.ui_hide_mer_status = option.hide_mer_status;
				this.ui_isLogin = option.isLogin;
				this.ui_viewColor = this.$Cache.get('VIEW_COLOR');
				// console.log("rk===>[viewcolor]" + this.viewColor);
				this.$store.commit('LOGIN', {
					token: option.token,
					time: 1000000000,
				});
				this.$store.commit('SETUID', option.uid);
			} else {
				this.ui_hide_mer_status = this.hide_mer_status;
				this.ui_isLogin = this.isLogin;
				this.ui_viewColor = this.viewColor;
			}
			//rk_tips_rtc<====

			let self = this
			this.toUid = option.uid || 0;
			this.productId = parseInt(option.productId) || 0;
			this.presellId = parseInt(option.presellId) || 0;
			this.combinationId = parseInt(option.combinationId) || 0;
			this.orderId = option.order_id || ""
			this.mer_id = option.mer_id || 0
			this.refund_order_id = option.refund_order_id || 0
			this.userId = option.userId || 0
			if (option.role && option.role == 'doctor') {
				this.isDoctor = true;
				console.log("rk===>[isDoctor]");
			}

			// 问诊会话id
			this.conversation_id = option.conversation_id || 0
			this.conversation_status = option.conversation_status || 0;
			this.patient_id = option.patient_id || 0;
			//console.log('rk===>[问诊商家id:]'+this.mer_id);
			if (option.send_tips) {
				this.send_tips = option.send_tips;
			}
			if (option.conversition_type) {
				this.conversition_type = option.conversition_type;
			}
			if (option.can_refund) {
				this.can_refund = option.can_refund;
			}
			if (this.conversition_type == 2 && this.can_refund == 1 && !this.isDoctor) {
				this.$nextTick(() => {
					this.consultType = 0;
					this.consultShow = true;
				});
			}

			if (this.conversation_id != 0) {
				uni.setNavigationBarTitle({
					title: '医生聊天'
				});
			}

			this.$nextTick(() => {
				uni.getSystemInfo({
					success: function(res) {
						self.windowH = res.windowHeight;
						self.windowW = res.windowWidth;
						self.inquiryH = (self.windowW) * 193.0 / 1037 + 15;
						self.chatTH = (self.windowW) * 193.0 / 1037 + 15;
						console.log('rk=====>chatTopH:' + self.inquiryH);
					}
				});
			});

			// #ifdef H5
			this.$nextTick(function() {
				var clipboard = new ClipboardJS('.copy-data');
				clipboard.on('success', function(e) {
					self.$util.Tips({
						title: '复制成功'
					})
				});
				clipboard.on('error', function(e) {
					self.$util.Tips({
						title: '复制失败'
					})
				});
			});
			// #endif
		},
		onReady() {},
		mounted: function() {

			let that = this
			that.height();

			if (that.ui_isLogin) {

				if (this.conversation_id != 0) {
					this.getInquiryHistory();

				} else if (that.userId == 0) {
					// 用户
					that.getHistory();
					that.getproductInfo();
					that.getOrderInfo();
					that.getRefundDetail();
					that.getStoreDetail();
				} else {
					// 客服
					that.getMerHistory();
				}
			} else {
				that.isAuto = true;
				that.isShowAuth = true
			}
			uni.$on("socket_open", () => {
				console.log(that.userId)
				if (that.userId == 0) {
					that.socket.send({
						data: {
							mer_id: that.mer_id,
							conversation_id: that.conversation_id,
						},
						type: "chat_start"
					});

					// 患者ID存在的时候发送患者信息
					if (that.patient_id != 0) {
						let msn = that.patient_id;
						that.socket.send({
							data: {
								msn,
								msn_type: 9,
								mer_id: that.mer_id,
								conversation_id: that.conversation_id,
							},
							type: "send_chat_inquiry",
						})
					}
					if (that.send_tips == 1) {
						let msn = '咨询已经提交，本次咨询为医生利用自由时间接诊，请随时关注医生接诊情况，及时与医生沟通。';
						that.socket.send({
							data: {
								msn,
								msn_type: 10,
								mer_id: that.mer_id,
								conversation_id: that.conversation_id,
							},
							type: "send_chat_inquiry",
						})
					}
				} else {
					that.socket.send({
						data: {
							uid: that.userId,
							mer_id: that.mer_id,
							conversation_id: that.conversation_id,
						},
						type: "service_chat_start"
					});
				}
			});
			uni.$on(["reply", "chat", "send_chat", "send_chat_inquiry"], data => {

				console.log("rk===>[收到消息]" + JSON.stringify(data));
				// 收到医生发起通话不能再取消预约
				if (data && data.msn_type == 11) {
					// 医生发起通话
					that.consultShow = false;
				} else if (data && data.msn_type == 12) {
					// 结束通话
					that.$refs.consultRtc.rtcCancelPush();
					that.rtcShow = false;
				} else if (data && data.msn_type == 13) {
					// 对方已结束问诊
					that.conversation_status = 1;
					if (that.rtcShow) {
						that.$refs.consultRtc.getChatEnd();
						that.rtcShow = false;
					}
				}
				if (data.conversation_id > 0 || !data.doctor_id || data.doctor_id == 0) {
					that.history.push(data);
					that.$forceUpdate();
					that.height();
				}

			});
			uni.$on("socket_error", () => {
				if (!that.isBack) {

					that.wsStart()
					// uni.showModal({
					// 	title: '提示',
					// 	content: '连接失败,是否重新连接',
					// 	success: function(res) {
					// 		if (res.confirm) {
					// 			self.wsStart()
					// 		} else if (res.cancel) {
					// 			uni.navigateBack();
					// 		}
					// 	}
					// });
				}
			});
			uni.$on("err_tip", data => {
				if (!this.isBack) {
					uni.showModal({
						title: '提示',
						content: data,
						success: function(res) {
							if (res.confirm) {
								console.log('用户点击确定');
							} else if (res.cancel) {
								console.log('用户点击取消');
							}
						}
					});
				}
			});
			uni.$on("socket_close", () => {
				console.log(that.isBack);
				if (!this.isBack) {
					let curRoute = this.$mp.page.route;
					let self = this
					uni.showModal({
						title: '提示',
						content: '连接断开，是否重新连接',
						success: function(res) {
							if (res.confirm) {
								self.wsStart()
							} else if (res.cancel) {
								uni.navigateBack();
							}
						}
					});
				}
			})
			this.wsStart();
		},
		methods: {
			/**
			 * 判断左右显示
			 */
			judgeShowLeft(item) {
				/**
				 * 原始逻辑：userId=0 的时候：
				 * send_type 1 在左边;   2 在右边;  
				 * 
				 * 现在医生医、助可在前台登录需作调整：
				 *  - 医生、医助发送 		send_type = 1 
				 *  - 患者发送 			send_type = 0 
				 *  - isDoctor = true 	是医生/医助
				 */
				let isLeft = true;
				if (this.isDoctor) {
					if (item.send_type == 1) {
						isLeft = false;
					} else {
						isLeft = true;
					}
				} else {
					if (item.send_type == 1) {
						isLeft = true;
					} else {
						isLeft = false;
					}
				}
				return isLeft;
			},
			/**
			 * 登录授权回调
			 *
			 */
			onLoadFun: function() {
				this.isShowAuth = false;

				if (this.conversation_id != 0) {
					console.log('rk==>1111')
					this.getInquiryHistory();

				} else if (this.userId == 0) {
					console.log('rk==>22222')
					// 用户获取和客服的聊天记录
					this.getHistory();
					this.getproductInfo();
					this.getOrderInfo();
					this.getRefundDetail();
					this.getStoreDetail();
				} else {
					console.log('rk==>33333')
					// 客服获取和用户的聊天记录
					this.getMerHistory();
				}
			},
			// 授权关闭
			authColse: function(e) {
				this.isShowAuth = e;
			},
			userDetail(uid) {
				this.wsEnd()
				uni.redirectTo({
					url: `/pages/chat/customer_info/index?uid=${uid}&mer_id=${this.mer_id}`
				})
			},
			// 联系客服拨打电话
			goCustomer() {
				uni.makePhoneCall({
					// 手机号
					phoneNumber: this.storeInfo.service_phone,
					// 成功回调
					success: (res) => {
						console.log('调用成功!')
					},
					// 失败回调
					fail: (res) => {
						console.log('调用失败!')
					}
				});
			},
			// 获取店铺详情
			getStoreDetail() {
				getStoreDetail(this.mer_id).then(res => {
					this.storeInfo = res.data
				})
			},
			// ws连接
			wsStart() {
				this.socket = new Socket();
				this.height();
			},
			// ws关闭
			wsEnd() {
				let that = this;
				if (that.userId == 0) {
					that.socket.send({
						data: {
							mer_id: that.mer_id,
							conversation_id: that.conversation_id,
						},
						type: "chat_end"
					});
				} else {
					that.socket.send({
						data: {
							uid: that.userId,
							mer_id: that.mer_id,
							conversation_id: that.conversation_id,
						},
						type: "service_chat_end"
					});
				}
				that.isBack = true
				that.socket && that.socket.onClose();
			},
			// 退款订单
			getRefundDetail() {
				if (this.refund_order_id) {
					refundDetail(this.refund_order_id).then(res => {
						this.refundDetail = res.data
					})
				}
			},
			uploadImg() {
				let self = this
				self.$util.uploadImageOne('upload/image', function(res) {
					if (res.status == 200) {
						self.sendMsg(res.data.path, 3)
					}
				});
			},
			getOrderInfo() {
				if (!this.orderId) return;
				getOrderDetail(this.orderId).then(res => {
					this.orderInfo = res.data;
					if (this.orderInfo.orderProduct.length) {
						this.cartInfo = this.orderInfo.orderProduct[0];
					}
				});
			},
			getproductInfo() {
				let that = this;
				if (!that.productId && !that.presellId && !that.combinationId) return;
				if (that.presellId || that.combinationId) {
					if (that.presellId) {
						getPresellProductDetail(that.presellId).then(res => {
							that.productInfo = res.data;
						});
					} else if (that.combinationId) {
						getCombinationDetail(that.combinationId).then(res => {
							that.productInfo = res.data.product;
						});
					}
				} else {
					getProductDetail(that.productId).then(res => {
						that.productInfo = res.data;
					});
				}
			},
			scroll() {
				if (window.scrollY < 300 && !this.loaded && !this.loading)
					this.getHistory();
			},
			imageuploaded(res) {
				console.log(res)
				if (res.status !== 200)
					return this.$util.Tips({
						title: res.msg || "上传图片失败"
					});
				this.sendMsg(res.data.url, 3);
			},
			// 用户聊天记录
			getHistory() {
				if (this.loading || this.loaded) return;
				this.loading = true;
				getChatRecord(this.mer_id, {
						page: this.page,
						limit: this.limit
					})
					.then(({
						data
					}) => {
						this.history = data.list.concat(this.history);
						if (this.page === 1) {
							this.$nextTick(function() {
								// window.scrollTo(0, document.documentElement.scrollHeight + 999);
								this.height();
							});
						}
						this.page++;
						this.loading = false;
						this.loaded = data.length < this.limit;
					})
					.catch(err => {
						this.$util.Tips({
							title: err.msg || "加载失败"
						});
					});
			},
			// 在线问诊聊天记录
			getInquiryHistory() {
				if (this.loading || this.loaded) return;
				this.loading = true;
				const last_id = this.history.length ? this.history[0].service_log_id : '';


				console.log('rk==>[con1]' + this.mer_id);
				console.log('rk==>[con2]' + this.conversation_id);

				getInquiryHistory(this.mer_id, this.conversation_id, {
						page: this.page,
						limit: this.limit,
						last_id
					})
					.then(({
						data
					}) => {
						this.history = data.list.concat(this.history);
						if (this.page === 1) {
							this.$nextTick(function() {
								this.height();
							});
						}
						this.page++;
						this.loading = false;
						this.loaded = data.length < this.limit;
					})
					.catch(err => {
						this.$util.Tips({
							title: err.msg || "加载失败"
						});
					});
			},
			// 客服聊天记录
			getMerHistory() {
				if (this.loading || this.loaded) return;
				this.loading = true;
				const last_id = this.history.length ? this.history[0].service_log_id : '';
				getMerHistory(this.userId, this.mer_id, {
						page: this.page,
						limit: this.limit,
						last_id
					})
					.then(({
						data
					}) => {
						this.history = data.list.concat(this.history);
						if (this.page === 1) {
							this.$nextTick(function() {
								this.height();
							});
						}
						this.page++;
						this.loading = false;
						this.loaded = data.length < this.limit;
					})
					.catch(err => {
						this.$util.Tips({
							title: err.msg || "加载失败"
						});
					});
			},
			focus: function() {
				this.active = false;
			},
			keyup: function() {
				//console.log(this.$refs.input.innerHTML.length);
				if (this.textCon.length > 0) {
					this.sendColor = true;
				} else {
					this.sendColor = false;
				}
			},
			addEmoji(name) {
				this.sendMsg(name, 2);
			},
			clickImg(url) {
				wx.previewImage({
					urls: [url],
					current: "",
					success: function(res) {},
					fail: function(res) {},
					complate: function(res) {}
				})
			},
			sendMsg(msn, type) {
				let self = this;
				console.log('rk==>[sendmsg]' + this.mer_id);

				// 测试消息
				// if(msn.length<=0){
				// 	msn = 11;
				// 	this.socket.send({
				// 		data: {
				// 			msn,
				// 			msn_type: 9,
				// 			mer_id: this.mer_id,
				// 			conversation_id: this.conversation_id,
				// 		},
				// 		type: "send_chat_inquiry",
				// 	})
				// 	return
				// }


				if (this.conversation_id != 0) {
					this.height();
					this.socket.send({
						data: {
							msn,
							msn_type: type,
							mer_id: self.mer_id,
							conversation_id: self.conversation_id,
						},
						type: "send_chat_inquiry",
					})
				} else if (this.userId == 0) {
					this.height();
					this.socket.send({
						data: {
							msn,
							msn_type: type,
							// to_uid: this.toUid,
							mer_id: self.mer_id
						},
						type: "send_chat",
					})
				} else {
					this.height();
					this.socket.send({
						data: {
							msn,
							msn_type: type,
							// to_uid: this.toUid,
							uid: self.userId,
							mer_id: self.mer_id
						},
						type: "service_chat",
					})
				}
			},
			sendTest() {
				this.sendMsg(this.textCon, 1);
				this.textCon = ''
				this.height();
			},
			sendProduct() {
				if (this.presellId || this.combinationId) {
					if (this.presellId) {
						this.sendMsg(this.presellId, 7);
						this.presellId = 0;
					} else if (this.combinationId) {
						this.sendMsg(this.combinationId, 8);
						this.combinationId = 0;
					}
				} else {
					this.sendMsg(this.productId, 4);
					this.productId = 0;
				}

				this.productInfo = {};
			},
			sendOrder() {
				this.sendMsg(this.orderId, 5);
				this.orderId = 0;
				this.orderInfo = {};
			},
			sendRefundOrder() {
				this.sendMsg(this.refund_order_id, 6);
				this.refund_order_id = 0;
				this.refundDetail = {};
			},
			bindInput: function(e) {
				if (e.detail.value) {
					this.sendColor = true
				} else {
					this.sendColor = false
				}
				this.height();
			},
			start() {
				var that = this;
				this.longClick = 0;
				this.timeOutEvent = setTimeout(function() {
					that.longClick = 1;
				}, 500);
				that.speak = "松开 结束";
				that.recording = true;
			},
			move() {
				clearTimeout(this.timeOutEvent);
				this.timeOutEvent = 0;
			},
			end() {
				clearTimeout(this.timeOutEvent);
				if (this.timeOutEvent !== 0 && this.longClick === 0) {
					//点击
					//此处为点击事件----在此处添加跳转详情页
				}
				this.speak = "按住 说话";
				this.recording = false;
				return false;
			},
			voiceBnt: function() {
				this.active = false;
				if (this.voice === true) {
					this.voice = false;
					this.$nextTick(function() {
						this.$refs.input.focus();
					});
				} else {
					this.voice = true;
				}
				// window.scrollTo(0, document.documentElement.scrollHeight);
				this.percent = 0;
				this.footerConH = 0;
				this.footerH = 0;
				this.$nextTick(function() {
					this.height();
				});
			},
			emoticon: function() {
				this.voice = false;
				// console.log(this.active)
				if (this.active === true) {
					this.active = false;
					// this.isBQ = false
					this.goodsViewBottom = 420
				} else {
					this.active = true;
					// this.isBQ = true
					this.goodsViewBottom = 420
				}

				console.log(this.active)
				this.height();
			},
			height() {
				let self = this
				var scrollTop = 0
				let info = uni.createSelectorQuery().select(".chat");
				setTimeout(res => {
					(!this.isBack) && info.boundingClientRect(function(data) { //data - 各种参数
						scrollTop = data.height
						if (self.active) {
							self.scrollTop = parseInt(scrollTop) + 500
							self.goodsViewBottom = 420
						} else {
							self.scrollTop = parseInt(scrollTop) + 100
							self.goodsViewBottom = 120
						}
					}).exec()
				}, 1000)
			},
			// 滚动到头部
			bindScroll() {
				console.log('滚动到头部')

				if (this.conversation_id != 0) {
					this.getInquiryHistory();

				} else if (this.userId == 0) {
					this.getHistory();
					this.getproductInfo();
					this.getOrderInfo();
					this.getRefundDetail();
					this.getStoreDetail();
				} else {
					this.getMerHistory();
				}
			},
			//#ifndef H5
			copyText: function(text) {
				uni.setClipboardData({
					data: text
				});
			},
			// #endif
			/**
			 * 结束问诊
			 */
			endInquiry() {

				if (this.rtcShow) {
					return this.$util.Tips({
						title: '视频通话中,请结束通话后尝试结束问诊'
					});
				}

				let that = this;
				uni.showModal({
					title: '提示',
					content: '是否结束问诊?',
					success: function(res) {
						if (res.confirm) {
							if (!that.isDoctor) {
								that.stopChat(1);
							} else {
								that.docStopChat();
							}
						} else if (res.cancel) {
							console.log('fouding')
						}
					}
				});
			},
			docStopChat() {
				let where = {
					'conversation_id': this.conversation_id,
					'type': '2'
				};
				endDoctorConsultation(where).then(res => {
					this.$util.Tips({
						title: res.message
					});
					if (res.status == 200) {
						this.conversation_status = 1;
						this.orderEndSocket();
					}
				}).catch(res => {
					this.$util.Tips({
						title: res
					});
				});
			},
			/**
			 * 患者结束
			 * endType：1-原有评价  2-视频结束后评价【弃用】
			 */
			stopChat(endType) {
				let that = this;
				let where = {
					'conversation_id': this.conversation_id
				};
				endConsultation(where).then(res => {
					//console.log('rk==>[end]' + JSON.stringify(res));
					if (res.status == 200) {
						if (endType == 1) {
							that.showEvaluate = true;
							that.conversation_status = 1;
							that.orderEndSocket();

						} else if (endType == 2) {
							that.consultType = 1;
							that.consultShow = true;
						}
					} else {
						that.$util.Tips({
							title: res.message,
						});
					}

				});
			},
			/**
			 * 评价相关
			 */
			evaluateClose() {
				this.showEvaluate = false;
				// this.conversation_status = 1;
				// // uni.navigateBack();
				// this.orderEndSocket();
			},
			/**
			 * 结束问诊socket
			 */
			orderEndSocket() {
				this.socket.send({
					data: {
						msn: '订单已结束',
						msn_type: 13,
						mer_id: this.mer_id,
						conversation_id: this.conversation_id,
					},
					type: "send_chat_inquiry",
				})
			},
			/**
			 * 预约、结束sheet
			 */
			consultClose() {
				this.consultShow = false;
			},
			/**
			 * 取消预约
			 */
			cancelReg() {
				// 二次确认
				this.regAlertShow = true;
			},
			/**
			 * 取消二次确认-点击取消
			 */
			regClose() {
				this.regAlertShow = false;
			},
			/**
			 * 取消二次确认-点击确认
			 */
			regFinish() {
				this.regAlertShow = false;
				this.conversation_status = 2;
				this.consultShow = false;
				// 发送socket隐藏底部会话输入
				this.orderEndSocket();
			},
			/**
			 * 音视频-结束后评价
			 */
			clickEvaluate() {
				this.showEvaluate = true;
			},
			/**
			 * 音视频-再次问诊
			 */
			clickAskAgain() {
				uni.switchTab({
					url: '/pages/shops/forlist/index'
				});
			},
			/**
			 * 医生发起视频
			 */
			startVideo() {
				this.rtcStartDeal()
			},
			/**
			 * 接听
			 */
			clickAccept() {
				this.rtcStartDeal()
			},
			rtcStartDeal() {
				if (this.rtcShow) {
					return this.$util.Tips({
						title: '正在视频通话中...'
					});
				}
				uni.showLoading({
					title: ' '
				})
				setTimeout(() => {
					this.$refs.consultRtc.getCreateRtcInfo()
				}, 1000);
			},

			/**
			 * UI展示
			 */
			rtcShowUI() {
				this.rtcShow = true;

				if (this.isDoctor) {
					// 视频邀请
					this.socket.send({
						data: {
							msn: '医生向您发起视频邀请',
							msn_type: 11,
							mer_id: this.mer_id,
							conversation_id: this.conversation_id,
						},
						type: "send_chat_inquiry",
					})
				}
			},
			/**
			 * 忙碌
			 */
			rtcBusy() {
				this.rtcShow = false;
			},
			/**
			 * 挂断
			 */
			rtcHangup(timeStr) {
				this.rtcShow = false;
				if (timeStr) {
					this.socket.send({
						data: {
							msn: timeStr,
							msn_type: 12,
							mer_id: this.mer_id,
							conversation_id: this.conversation_id,
						},
						type: "send_chat_inquiry",
					})
				}
				/* 弃用此处，改外原流程结束订单
				if(!this.isDoctor){
					this.stopChat(2);
				}
				*/
			}

		}
	};
</script>

<style lang="scss">
	page {
		width: 100%;
		height: 100%;
	}

	@import url("@/plugin/emoji-awesome/css/google.min.css");

	.noPad {
		padding: 0 !important;
		margin-bottom: 0 !important;
		height: auto !important;
	}

	.broadcast-details_num {
		width: 100%;
		height: 72rpx;
		line-height: 72rpx;
		color: #666666;
		font-size: 26rpx;
		display: flex;
		justify-content: space-between;
		background: #fff;
		border-bottom: 1px solid #F5F5F5;
		padding: 0 24rpx;
		border-radius: 10rpx 10rpx 0 0;

		.line1 {
			max-width: 203rpx;
		}
	}

	.footer_count {
		margin-top: 20rpx;
		width: 710rpx;
		position: fixed;
		// bottom: 120rpx;
		left: 20rpx;

		.broadcast-details_box,
		.broadcast_box {
			margin-bottom: 0;
			position: relative;
		}

		.icon-guanbi {
			font-size: 20rpx;
			color: #C4C4C4;
			position: absolute;
			right: 20rpx;
			top: 20rpx;
		}
	}

	.broadcast-details_order {
		// padding: 15rpx;
		// margin-bottom: 100px;
	}

	.copy {
		color: var(--view-theme);
		margin-left: 24rpx;
		font-size: 22rpx;
		opacity: .5;
	}

	.broadcast-details_box {
		padding: 20rpx;
		display: flex;
		background: #fff;
		border-radius: 0 0 10px 10rpx;
		margin-bottom: 24rpx;
	}

	.broadcast_details_model {
		width: 100%;
		height: 43rpx;
		background: rgba(0, 0, 0, 0.5);
		border-radius: 0px 0px 8px 8px;
		position: relative;
		margin-top: -53rpx;
		// position: absolute;
		// z-index: 2;
		// bottom: 0;
		font-size: 22rpx;
		color: #fff;
		text-align: center;
		line-height: 43rpx;
	}

	.broadcast_details_img {
		width: 160rpx;
		height: 160rpx;
		border-radius: 10px;
		// overflow: hidden;
		position: relative;
	}

	.broadcast_details_img uni-image {
		width: 160rpx;
		height: 160rpx;
	}

	.broadcast_details_img_no {
		width: 456rpx;
		height: 456rpx;
		border-radius: 10px 10px 0px 0px;
		overflow: hidden;
		margin-bottom: 10rpx;
	}

	.broadcast_details_picBox_no {
		width: 100%;
	}

	.broadcast_details_img_no uni-image,
	.broadcast_details_img_no img {
		width: 100%;
		height: 100%;
	}

	.broadcast_details_tit {
		font-size: 30rpx;
		color: #282828;
		height: 40rpx;
		max-width: 400rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
		text-align: left !important;

	}

	.product_price {
		margin-top: 66rpx;
	}

	.broadcast_details_tit_no {
		font-size: 28rpx;
		color: #333333;
		font-weight: 800;
		text-align: left;
		margin-top: 5rpx;
		max-width: 420rpx;
	}

	.broadcast_details_picBox {
		width: 75%;
		margin-left: 24rpx;
	}

	.broadcast_details_pic {
		margin-top: 15rpx;
		font-size: 24rpx;
		color: #999999;
		text-align: left;
	}

	.broadcast_details_pic_num {
		text-decoration: line-through;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.5);
		margin-left: 0.1rem;
	}

	.broadcast_details_btn {
		width: 130rpx;
		height: 50rpx;
		background: var(--view-theme);
		opacity: 1;
		border-radius: 125rpx;
		color: #fff;
		font-size: 24rpx;
		text-align: center;
		line-height: 50rpx;
		margin-top: 16px;
		float: right;

		&.product_btn {
			margin-top: 0;
			float: none;
		}

		&.refund_btn {
			width: 150rpx;
		}
	}

	.p-color {
		color: var(--view-priceColor);
	}

	.broadcast-details .chat {
		padding: 1rpx 23rpx 0 23rpx;
		margin-bottom: 3rpx;
	}

	.broadcast-details .chat .item {
		margin-top: 37rpx;
	}

	.broadcast-details .chat .item .pictrue {
		width: 80rpx;
		height: 80rpx;
		margin-top: 10rpx;
	}

	.broadcast-details .chat .item .pictrue image {
		width: 100%;
		height: 100%;
		border-radius: 50%;
	}

	.broadcast-details .chat .item .text {
		margin-left: 20rpx;
	}

	.broadcast-details .chat .item .text.textR {
		text-align: right;
		margin: 0 20rpx 0 0;
	}

	.broadcast-details .chat .item .text .name {
		font-size: 24rpx;
		color: #999;
	}

	.broadcast-details .chat .item .text .name .return {
		color: #509efb;
		margin-left: 17rpx;
	}

	.broadcast-details .chat .item .text.textR .name .return {
		margin: 0 0.17rem 0 0;
	}

	.broadcast-details .chat .item .text .conter {
		background-color: #fff;
		border-radius: 8rpx;
		padding: 16rpx 20rpx;
		font-size: 30rpx;
		color: #333;
		position: relative;
		max-width: 600rpx;
		margin-top: 2rpx;
		word-break: break-all;
		text-align: left;

		.em {
			margin: 0;
		}
	}

	.broadcast-details .chat .item .text .spot {
		width: 15rpx;
		height: 15rpx;
		background-color: #c00000;
		border-radius: 50%;
		margin-left: 20rpx;
	}

	.broadcast-details .chat .item .text .conter:before {
		position: absolute;
		content: "";
		width: 0;
		height: 0;
		border-bottom: 9rpx solid transparent;
		border-right: 14rpx solid #fff;
		border-top: 9rpx solid transparent;
		left: -14rpx;
		top: 25rpx;
	}

	.broadcast-details .chat .item .text.textR .conter:before {
		left: unset;
		right: -14rpx;
		transform: rotateY(180deg);
	}

	.broadcast-details .chat .item .text .conter img {
		/* #ifdef H5 */
		width: 100%;
		/* #endif */
		display: block;
	}

	.broadcast-details .chat .item .text .conter .signal {
		width: 48rpx;
		height: 48rpx;
	}

	.broadcast-details .chat .item .text .conter .signal.signalR {
		transform: rotate(180deg);
		-ms-transform: rotate(180deg);
		-webkit-transform: rotate(180deg);
	}

	.broadcast-details .inquiry-end {
		position: absolute;
		bottom: 120rpx; // 闪出 .footerCon 的高度
		bottom: calc(120rpx + constant(safe-area-inset-bottom));
		bottom: calc(120rpx + env(safe-area-inset-bottom));
		// z-index: 3;//99
		background-color: #ff1717;
		margin-left: 20rpx;
		height: 50rpx;
		display: flex;
		align-items: center;
		padding: 0 20rpx;
		border-radius: 8rpx;
		color: #fff;

		.yyfont {
			margin-right: 6rpx;
		}
	}

	.broadcast-details .inquiry-end.on {
		bottom: 420rpx;
		transform: translate3d(0, 0, 0) !important;
	}

	.broadcast-details .inquiry-rtc-start {
		position: absolute;
		bottom: 120rpx; // 闪出 .footerCon 的高度
		bottom: calc(120rpx + constant(safe-area-inset-bottom));
		bottom: calc(120rpx + env(safe-area-inset-bottom));
		// z-index: 3;//99
		right: 0;
		margin-right: 20rpx;
		height: 50px;
		display: flex;
		align-items: center;
		padding: 0 20rpx;
		border-radius: 8rpx;
		color: #fff;

		image {
			width: 50px;
			height: 50px;
		}
	}

	.broadcast-details .inquiry-rtc-start.on {
		bottom: 420rpx;
		transform: translate3d(0, 0, 0) !important;
	}

	.broadcast-details .inquiry-bot {
		padding-bottom: 70rpx;
	}

	.broadcast-details .inquiry-status.tool-hidden {
		display: none;
	}

	.broadcast-details .footerCon {
		height: 100rpx;
		width: 100%;
		transition: all 0.005s cubic-bezier(0.25, 0.5, 0.5, 0.9);
		background-color: #fff;
	}

	.broadcast-details .footerCon.noactive {
		height: calc(100rpx + constant(safe-area-inset-bottom));
		height: calc(100rpx + env(safe-area-inset-bottom));
	}

	.broadcast-details .footerCon.on {
		position: relative;
		top: -300rpx;
		transform: translate3d(0, 0, 0) !important;
	}

	.broadcast-details .footerCon .banner .swiper-slide {
		flex-wrap: wrap;
		-webkit-flex-wrap: wrap;
		background-color: #fff;
		padding-bottom: 50rpx;
		border-top: 1px solid #f5f5f5;
	}

	.broadcast-details .footerCon .banner .swiper-slide .emoji-outer,
	.swiper-slide .em {
		display: block;
		width: 50rpx;
		height: 50rpx;
		margin: 40rpx 0 0 50rpx;
	}

	.broadcast-details .footerCon .banner .swiper-container-horizontal>.swiper-pagination-bullets {
		bottom: 10rpx;
	}

	.broadcast-details .footerCon .slider-banner .swiper-pagination-bullet-active {
		background-color: #999;
	}

	.broadcast-details .recording {
		width: 300rpx;
		height: 300rpx;
		position: fixed;
		top: 40%;
		left: 50%;
		margin-left: -150rpx;
	}

	.broadcast-details .recording img {
		width: 100%;
		height: 100%;
	}

	.broadcast-details .footer {
		width: 100%;
		background-color: #fff;
		padding: 17rpx 26rpx;
	}

	.footer_box {
		margin-top: 260rpx;
	}

	.broadcast-details .footer image {
		width: 61rpx;
		height: 60rpx;
		display: block;
	}

	.broadcast-details .footer .icon-biaoqing2,
	.broadcast-details .footer .icon-tupian2 {
		font-size: 60rpx;
		display: block;
	}

	.broadcast-details .footer .voice {
		width: 440rpx;
		border-radius: 10rpx;
		background-color: #e5e5e5;
		/* padding: 17rpx 30rpx; */
		height: 60rpx;
		padding-left: 20rpx;
	}

	.broadcast-details .footer .input_count {
		margin-left: 20rpx;
		width: 544rpx;
		border-radius: 38rpx;
		background-color: #F6F6F6;
		padding: 0 80rpx 0 30rpx;
		height: 76rpx;
		position: relative;
	}

	.broadcast-details .footer .placeholder {
		color: #999999;
		font-size: 26rpx;
	}

	.broadcast-details .footer .input {
		max-height: 150rpx;
		overflow-y: auto;
		overflow-x: hidden;
		color: #999999;
		height: 76rpx;
		font-size: 26rpx;
	}

	.broadcast-details .footer .send {
		font-size: 48rpx;
		color: $yy-main-col;
		position: absolute;
		right: 15rpx;
		top: 15rpx;
	}

	.em {
		display: inline-block;
		width: 50rpx;
		height: 50rpx;
		margin: 40rpx 0 0 50rpx;
	}

	.emoji-outer {
		position: absolute;
		right: 70rpx;
		/* bottom: 12rpx; */
		width: 50rpx;
		height: 50rpx;
		margin: 40rpx 0 0 50rpx;
	}

	.broadcast-details {
		display: flex;
		flex-direction: column;
		width: 100%;
		overflow: hidden;

		.hd-wrapper {
			flex: 1;
			display: flex;
			flex-direction: column;
			overflow: hidden;

			&.on {
				padding-bottom: 300rpx;
			}
		}

		position: relative;
	}

	.store-wrapper {

		.store-box {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 15rpx 20rpx;
			background-color: #fff;

			image {
				width: 60rpx;
				height: 60rpx;
				margin-right: 10rpx;
			}

			.left {
				display: flex;
				align-items: center;
			}

			.link {
				width: 80rpx;
				height: 40rpx;
				line-height: 38rpx;
				border: 1px solid var(--view-theme);
				border-radius: 20px;
				font-size: 24rpx;
				color: var(--view-theme);
				text-align: center;
			}

			.store-opeation {
				align-items: center;

				.icon-dadianhua01 {
					color: var(--view-theme);
					margin-left: 28rpx;
					font-size: 34rpx;
				}
			}
		}


		.chat-top {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 15rpx 20rpx;
			background-color: #f5f5f5;
			width: 100%;

			image {
				width: 100%;
				height: 100%;
				border-radius: 20rpx;
			}
		}

	}

	.inquiry-top {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 15rpx 20rpx;
		background-color: #f5f5f5;
		width: 100%;

		image {
			width: 100%;
			height: 100%;
			border-radius: 20rpx;
		}
	}
</style>